const buf =Buffer.from('this is a buffer!');
const buf2 =Buffer.from('测试');
const buf3 =Buffer.alloc(10);
buf3[0]=2;
const buf4 =Buffer.allocUnsafe(10);


console.log(buf.length)
console.log(buf2.length)
console.log(buf3.length)
console.log(buf4.length)


console.log(buf.toString('base64'));

const buf5=Buffer.allocUnsafe(10)
console.log(buf5);
console.log(buf5.fill(10,2,6))

const buf6=Buffer.from('test');
const buf7=Buffer.from('test');
const buf8=Buffer.from('test!');


console.log(buf6.equals(buf7))
console.log(buf6.equals(buf8))

console.log(buf6.indexOf('es'));